﻿@model Finance.Web.Models.DepostAccounting

<h3>Рассчет суммы вклада</h3>

<form class="form-horizontal" name="depositForm">

   <div class="form-group">
    <label for="deposit" class="col-sm-2 control-label">Депозит</label>
    <div class="col-sm-8">
        <input id="deposit" type="text" data-ng-model="model.Deposit" placeholder="Выберите депозит" name="Deposit"  data-typeahead="state as state.Name for state in loadDeposites($viewValue)" class="form-control" required>
    </div>
  </div>

   <div class="form-group">
    <label for="amount" class="col-sm-2 control-label">Сумма</label>
    <div class="col-sm-8">
      <input type="number"  class="form-control" name="Amount" data-ng-model="model.Amount" id="amount" min="0" data-currency="">
    </div>
  </div>

   <div class="form-group">
    <label for="addamount" class="col-sm-2 control-label">Сумма дополнительных</label>
    <div class="col-sm-8">
      <input type="number"  class="form-control" name="AddAmount" data-ng-model="model.AddAmount" id="addamount" min="0" data-currency="">
    </div>
  </div>

  @*<div class="form-group">
    <label for="from" class="col-sm-2 control-label">Дата октрытия</label>
    <div class="col-sm-8" data-ng-show="true">
        <p class="input-group">
            <input type="text" class="form-control" id="from" data-datepicker-popup="" data-ng-model="model.OpeningDate" data-is-open="openedOpening" data-datepicker-options="" data-ng-required="true"/>
            <span class="input-group-btn">
                <button class="btn btn-default" data-ng-click="openedOpening=!openedOpening;"><i class="glyphicon glyphicon-calendar"></i></button>
            </span>
        </p>
    </div>
  </div>

  <div class="form-group">
    <label for="to" class="col-sm-2 control-label">Дата закрытия</label>
    <div class="col-sm-8" data-ng-show="true">
         <p class="input-group">
            <input type="text" class="form-control" id="to" data-datepicker-popup="" data-ng-model="model.EndDate" data-is-open="openedEnd" data-datepicker-options=""/>
            <span class="input-group-btn">
                <button class="btn btn-default" data-ng-click="openedEnd=!openedEnd;"><i class="glyphicon glyphicon-calendar"></i></button>
            </span>
        </p>
    </div>
  </div>*@

    <div class="form-group" data-ng-show="!!result">
        <label for="result" class="col-sm-2 control-label">Результат</label>
        <div class="col-sm-8" data-ng-show="true">
            <div class="form-control">{{result | currency:" "}}</div>
        </div>
    </div>

    
  <div class="form-group">
    <div class="col-sm-8 col-sm-offset-2">
        <div class="checkbox">
        <label>
          <input type="checkbox" name="" data-ng-model="showByMonth"> Показать по месяцам
        </label>
      </div>
    </div>
  </div>

    <div class="form-group" data-ng-show="!!result && showByMonth">
     <div class="col-sm-8 col-sm-offset-2">
            <table class="table table-hover table-bordered">
                <thead>
                    <tr>
                        <th>#</th>
                        <th>Сумма</th>
                    </tr>
                </thead>
                <tbody>
                    <tr data-ng-repeat="dep in byMonth">
                        <td>{{$index+1}}</td>
                        <td>{{dep | currency : " "}}</td>
                    </tr>
                </tbody>
            </table>
        </div>   
    </div>
   
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-2">
      <button type="submit" data-ng-click="calculate()" class="btn">Рассчитать</button>
    </div>
  </div>  
</form>

